package com.softeem.idriveserver.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.softeem.idriveserver.entity.Admin;
import com.softeem.idriveserver.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AdminController {
    @Autowired
    private AdminService adminService;

    @GetMapping("/admin/list")
    public List<Admin> list(@RequestParam(defaultValue = "1") Integer page,
                            @RequestParam(defaultValue = "5") Integer limit){
        return adminService.list(new Page<>(page,limit));
    }
}
